package com.example.inprinciple.singleResponsibility;

/**
 * 创建日期：2022/6/2 0002 20:13
 *
 * @author tony.sun
 * 类说明：
 */
public class SingleResponsibility3 {
    public static void main(String[] args) {
        Vehicle2 vehicle = new Vehicle2();
        vehicle.run("汽车");
        vehicle.run("电动车");
        vehicle.runAir("飞机");
    }
}

class Vehicle2{
    public void run(String vehicle){
        System.out.println(vehicle+"在公路上跑");
    }
    public void runAir(String vehicle){
        System.out.println(vehicle+"在天上飞");
    }
    public void runWater(String vehicle){
        System.out.println(vehicle+"在水上游");
    }
}



